﻿//********************************************************************************//
//创建日期：<创建日期，2016-06-18>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：地下水打印数据导出公用Model
//********************************************************************************//
using System;
using System.Collections.Generic;
using YXYLCommon;
using System.Data;

namespace Entity
{
    [Serializable]
    /// <summary>
    /// 打印数据导出MODEL
    /// </summary>
    public class QSQTDaYinSJDC : BaseModel
    {
        public QSQTDaYinSJDC()
        {

        }
        public string Y { get; set; }
        public string M { get; set; }
        public string YHH { get; set; }
        public string YHM { get; set; }
        public string DIZHI { get; set; }
        public string YOUBIAN { get; set; }
        public string YHZH { get; set; }
        public string KHHM { get; set; }
        public string KHYH { get; set; }
        public string BYCM { get; set; }
        public string KPS { get; set; }
        public string DANJIA { get; set; }
        public string JINE { get; set; }
        public string DAXIEJE { get; set; }
        public string ZDBH { get; set; }
        public string JIAOKUANR { get; set; }
        public string TSBZ { get; set; }
        public string FYLX { get; set; }
        public string BZ { get; set; }
        public string LXR { get; set; }
        public string CWHM { get; set; }
        
        public DbDateTime XJRQ { get; set; }


        public override BaseModel ToObject(System.Data.DataRow row)
        {
            this.IsExists = true;
            this.Y = row.Table.Columns.Contains("Y") ? Convert.ToString(row["Y"]) : null;
            this.M = row.Table.Columns.Contains("M") ? Convert.ToString(row["M"]) : null;
            this.YHH = row.Table.Columns.Contains("YHH") ? Convert.ToString(row["YHH"]) : null;
            this.YHM = row.Table.Columns.Contains("YHM") ? Convert.ToString(row["YHM"]) : null;
            this.DIZHI = row.Table.Columns.Contains("DIZHI") ? Convert.ToString(row["DIZHI"]) : null;
            this.YOUBIAN = row.Table.Columns.Contains("YOUBIAN") ? Convert.ToString(row["YOUBIAN"]) : null;
            this.YHZH = row.Table.Columns.Contains("YHZH") ? Convert.ToString(row["YHZH"]) : null;
            this.KHHM = row.Table.Columns.Contains("KHHM") ? Convert.ToString(row["KHHM"]) : null;
            this.KHYH = row.Table.Columns.Contains("KHYH") ? Convert.ToString(row["KHYH"]) : null;
            this.BYCM = row.Table.Columns.Contains("BYCM") ? Convert.ToString(row["BYCM"]) : null;
            this.KPS = row.Table.Columns.Contains("KPS") ? Convert.ToString(row["KPS"]) : null;
            this.DANJIA = row.Table.Columns.Contains("DANJIA") ? Convert.ToString(row["DANJIA"]) : null;
            this.JINE = row.Table.Columns.Contains("JINE") ? Convert.ToString(row["JINE"]) : null;
            this.DAXIEJE = row.Table.Columns.Contains("DAXIEJE") ? Convert.ToString(row["DAXIEJE"]) : null;
            this.ZDBH = row.Table.Columns.Contains("ZDBH") ? Convert.ToString(row["ZDBH"]) : null;
            this.JIAOKUANR = row.Table.Columns.Contains("JIAOKUANR") ? Convert.ToString(row["JIAOKUANR"]) : null;
            this.TSBZ = row.Table.Columns.Contains("TSBZ") ? Convert.ToString(row["TSBZ"]) : null;
            this.FYLX = row.Table.Columns.Contains("FYLX") ? Convert.ToString(row["FYLX"]) : null;
            this.BZ = row.Table.Columns.Contains("BZ") ? Convert.ToString(row["BZ"]) : null;
            this.LXR = row.Table.Columns.Contains("LXR") ? Convert.ToString(row["LXR"]) : null;
            this.CWHM = row.Table.Columns.Contains("CWHM") ? Convert.ToString(row["CWHM"]) : null;
            this.XJRQ = row.Table.Columns.Contains("XJRQ") ? DbDateTime.Parse(row["XJRQ"]) :  DbDateTime.Parse(null);
            return this;
        }
    }
    public class DALQSQTDaYinSJDC : BaseDAL
    {
        public DALQSQTDaYinSJDC()
        {

        }
        protected override void fillSaveProc(BaseModel model)
        {

        }

        /// <summary>
        /// 打印数据导出获取
        /// </summary>
        /// <param name="zwym">账务年月</param>
        /// <param name="type">类型 0:通知书 1:到账账单 2:非到账账单 3:一般用户账单 4:特殊用户账单</param>
        /// <param name="qy">区域 0:大地 1:崇明 2:长兴 3:横沙</param>
        public List<QSQTDaYinSJDC> Get(int zwym, int type, int qy)
        {
            dbProc.Init("P_QSQT_DAYINSJDC");
            dbProc.AddParameter("V_ZWYM", zwym);
            dbProc.AddParameter("V_TYPE", type);
            dbProc.AddParameter("V_QUYU", qy);
            return CommonService.Ini().GetList<QSQTDaYinSJDC>(dbProc);
        }
    }

}